var app = getApp();

Page({
    data: {
        tex: ["人数", "头像", "邀请人", "步数", "时间"],
        moneyList: []
    },
    onLoad: function (a) {
        var e = this;
        e.Headcolor(), app.util.request({
            url: "entry/wxapp/Invitelog",
            method: "POST",
            data: {
                user_id: app.globalData.user_id
            },
            success: function (a) {
                var t = a.data.data.invitelog, o = a.data.data.invitetype;
                e.setData({
                    list: t,
                    invitetype: o
                });
                e.data.list.forEach(function (item, index) {
                    e.data.moneyList.push(item.money.substring(0, item.money.indexOf(".") + 3))
                })
                e.setData({
                    moneyList: e.data.moneyList
                })
            }
        });
    },
    onReady: function () { },
    Headcolor: function () {
        var i = this;
        app.util.request({
            url: "entry/wxapp/Headcolor",
            method: "POST",
            data: {
                user_id: app.globalData.user_id
            },
            success: function (a) {
                var t = a.data.data.inviteball, o = a.data.data.sonlist, e = a.data.data.set;
                app.globalData.setaa = a.data.data.set;
                var n = e.shenhe;
                i.setData({
                    inviteball: t,
                    sonlist: o,
                    setaa: e,
                    shenhe: n
                }), wx.setNavigationBarColor({
                    frontColor: "#ffffff",
                    backgroundColor: e.headcolor
                }), wx.setNavigationBarTitle({
                    title: e.xcx
                });
            },
            fail: function (a) {
                console.log("失败" + a);
            }
        });
    },
    onShow: function () { },
    onHide: function () { },
    onUnload: function () { },
    onPullDownRefresh: function () { },
    onReachBottom: function () { },
    onShareAppMessage: function () { }
});